<?php

namespace App\Library\Logic;

use App\Models\ShopUserPriceWaitingModel;
use Illuminate\Database\Eloquent\Model;

class ShopUserPriceWaitingLogic extends ShopUserPriceWaitingModel
{
    public static function add(Model $order): void
    {
        self::insertForModel([
            'sellUserId' => $order->sell_user_id,
            'upwSourceId' => $order->order_id,
            'upwPrice' => $order->pay_price,
            'upwEnsurePrice' => $order->order_ensure_price,
            'upw_remark' => "订单($order->serial_number)收入：{$order->pay_price}元,已扣保费：{$order->order_ensure_price}元",
            'upwAddTime' => time(),
            'createdAt' => time(),
            'updatedAt' => time(),
        ]);
    }
}
